Ext.define('js.foundation.foundationJgysAPage', {
    extend: 'Ext.form.Panel',
    requires: ['js.Util', 'js.ctrl.Common'],
    controller: 'Common',
    config: {
        bodyPadding: '0 20 0 20',
        layout: {
            type: 'vbox',
            align: 'stretch'
        }
    },
    hidenField: {
        region_id: undefined
    },
    fieldDefaults: {
        flex:1,
        xtype: 'panel',
        allowBlank: false
    },
    initComponent: function () {

        Ext.QuickTips.init();
        Ext.form.Field.prototype.msgTarget = 'under';
        let clbssj = {
            xtype: 'datefield',
            editable:false,
            name: 'inspection_date',
            id: 'inspection_date',
            allowBlank: false,
            value:this.inspection_date,
            msgTarget : 'qtip',
            margin:'10 0 0 0',
            labelSeparator: '',
            fieldLabel: '材料报送时间:'
        };
        let bbrid= {
            xtype: 'textfield',
            name: 'user_id',
            id: 'user_id_bbrA',
            allowBlank: false,
            value:this.user_id,
            hidden:true
        };

        let bbr= {
            xtype: 'textfield',
            id: 'user_name_bbrA',
            name:'user_name',
            value:this.user_name,
            allowBlank: false,
            msgTarget : 'qtip',
            margin:'10 0 0 0',
            labelSeparator: '',
            fieldLabel: '报备人:',
            listeners: {
                render: function(p) {
                    p.getEl().on('click', function(p){
                        let a = Ext.getCmp('BasGraphAddWindow');
                        if(a) a.remove(a);
                        let formPanel = Ext.create('js.basicInformation.BasGraphAddWindow',{
                            idA:'user_id_bbrA',
                            nameA:'user_name_bbrA',
                            actionType:'dan'
                        });
                        let win = util.window(formPanel, {title:'添加报备人员' ,width:'600',height:'600'});
                        win.show();
                    });
                }}
        };

        let jgrq = {
            xtype: 'datefield',
            editable:false,
            name: 'completion_date',
            id: 'completion_date',
            allowBlank: false,
            value:this.completion_date,
            msgTarget : 'qtip',
            margin:'10 0 0 0',
            labelSeparator: '',
            fieldLabel: '竣工日期:'
        };
        let bz= {
            xtype: 'textarea',
            name: 'remarks',
            id: 'remarks',
            allowBlank: false,
            msgTarget : 'qtip',
            value:this.remarks,
            margin:'10 0 0 0',
            flex:3,
            labelSeparator: '',
            fieldLabel: '备注:',
        };
        let items = [clbssj,bbrid,bbr,jgrq,bz];

        this.items = items;

        this.callParent(arguments);
    }
});